// token
const SDZK_WEB_auth_key = 'SDZK_WEB_auth_key'
// 进入企业首页session中需要有的key值，需要在store中存储，方便读取
const SDZK_WEB_user_key = 'SDZK_WEB_user_key'

export const cacheToken = value => sessionStorage.setItem('token', value)
export const getToken = () => sessionStorage.getItem('token')
export const removeToken = () => sessionStorage.removeItem('token')

export const cacheCompanyId = id => sessionStorage.setItem('company_id', id)
export const readCompanyId = () => sessionStorage.getItem('company_id')
export const removeCompanyId = () => sessionStorage.removeItem('company_id')

export const cacheGeoJson = (name, json) =>
  sessionStorage.setItem(name, JSON.stringify(json))
export const getCacheGeoJson = name => JSON.parse(sessionStorage.getItem(name))
